<div id="nav">
    <nav class="container nav-header">
        <div class="text-center">
            <span class="glyphicon glyphicon-chevron-left back"></span>
            <span class="title"> <%= title %></span>
            <span class="glyphicon glyphicon-home home"></span>
        </div>
    </nav>
</div>

<div class="container">
    <!--回复的展示 -->
    <div class="answerDetail">
        <h4 class="answerTitle">回复:<%= ask.answers.length %></h4>
        <% ask.answers.forEach(function (answer) { %>
        <div class="answerContent">
            <div id="answerContent">
                <p>
                    <span>回复人： <%= answer.name %></span>&#x3000
                    <span>回复时间：<%= answer.time %></span>
                </p>
                <h4>回复内容</h4>
                <p>
                    <%- answer.content %>
                </p>
            </div>
        </div>
        <% }) %>
        <!--没有回复的时候给用用户提示-->
        <p class="answerEmpty">
            目前还没有回复,赶快回复抢沙发吧!
            <img src="/images/smile.png" alt="" height="30">
        </p>
    </div>
    <!--添加回复的表单-->
    <% if(user){ %>
    <div id="addAnswer">
        <form role="form" method="post" action="/answer/<%= ask.name %>/<%= ask.time.second %>/<%= ask.askTitle %>">
            <input type="hidden" name="name" value="<%= user.name %>"/><br/>
            <div class="form-group">
                <h4>请回答</h4>
                <textarea class="form-control" name="content" rows="10" placeholder="请详细描述您的问题"
                          required="required"></textarea>
            </div>
            <button class="btn btn-block btn-primary">回答</button>
        </form>
    </div>
    <% } else { %>
    <h4 class="btn-notLogin">
        添加回复请先
        <a class=" btn btn-primary btn-login" href="/login">登录</a>
        或
        <a class=" btn btn-primary btn-reg" href="/reg">注册</a>
    </h4>
    <% } %>
</div>

